//
//  BCShopStyleCell.m
//  BangcaiSale
//
//  Created by lsy on 16/7/19.
//  Copyright © 2016年 Bangcai. All rights reserved.
//

#import "BCShopStyleCell.h"

@interface BCShopStyleCell ()
{
    UIImageView *img;
    UILabel *lab;
    NSString *imgName;
    UIColor *bgColor;
}
@end

@implementation BCShopStyleCell

- (instancetype)initWithstyle:(NSInteger)style
{
    self = [super init];
    if (self) {
        [self createViewWith:style];
    }
    return self;
}


- (void)createViewWith:(NSInteger)style
{
        switch (style) {
        case 0:{
        imgName = @"禽蛋肉品";
            bgColor = [UIColor colorWithRed:0.999  green:0.637  blue:0.637 alpha:.3];
        }
            break;
        case 1:
        {
           imgName = @"蔬菜水果";
            bgColor =[UIColor colorWithRed:0.782  green:0.654  blue:1 alpha:.3];
        }
            break;
        case 2:
        {
           imgName = @"水产冻品";
            bgColor =[UIColor colorWithRed:0.454  green:0.829  blue:1 alpha:.3];
        }
            break;
        case 3:
        {
          imgName = @"调料其它";
            bgColor =[UIColor colorWithRed:0.421  green:0.917  blue:0.820 alpha:.3];
        }
            break;
        case 4:
        {
            imgName = @"米面粮油";
            bgColor =[UIColor colorWithRed:1  green:0.823  blue:0.487 alpha:.3];
        }
            break;
        case 5:
        {
           imgName = @"酒水饮料";
            bgColor =[UIColor colorWithRed:0.998  green:0.698  blue:0.999 alpha:.3];
        }
            break;
        case 6:
        {
           imgName = @"熟食面点";
            bgColor =[UIColor colorWithRed:0.833  green:0.943  blue:0.557 alpha:.3];
        }
            break;
        case 7:
        {
            imgName = @"厨房用品";
            bgColor =[UIColor colorWithRed:0.999  green:0.708  blue:0.454 alpha:.3];
        }
            break;
       
        default:
            break;
    }
    img = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imgName]];
    lab = [[UILabel alloc] init];
    lab.text = imgName;
    lab.font = [UIFont systemFontOfSize:16];
    lab.textColor = [UIColor whiteColor];
    [self addSubview:img];
    [self addSubview:lab];
    
    self.layer.cornerRadius = 20;
    self.backgroundColor = bgColor;
    
    [img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.width.and.height.mas_equalTo(self.mas_height);
        make.top.mas_equalTo(0);
    }];
    
    [lab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(0);
    }];
}

@end
